﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Lesson12_继承_继承的基本规则
{
   
    class Computer

    {
        public string screen;
        public void Startup()
        {
            Console.WriteLine("计算机正在开机，请等待");
        }
    }
    class iPad: Computer
    {
        public string battery;

    }
    internal class Program
    {
        static void Main(string[] args)
        {
            //总结
            //1:继承的基本语法
            //class:类名;父类名
            //1:单根型
            //2:传递性
            // 3;访问修饰符 对于成员的影响

            #region  书中例8.10、
            //Computer cpu = new Computer();
            //cpu.screen = "液晶显示屏 "; 
            //cpu.Startup();
            //iPad m = new iPad();
            //m.screen = "显示屏";
            //m.battery = "5000毫安";
            //m.Startup();
            //Console.WriteLine(m.screen);
            //Console.WriteLine(m.battery);
            
            #endregion 
        }
    }
}
